package models;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import models.Workday.WorkdayType;
import play.data.validation.Required;
import play.db.jpa.Model;

@Entity
public class PunchTime extends Model {

	@Required
	@ManyToOne
	public TimeUser user;

	@Required
	public Date timeStamp;

	public String comment;

	public TimeLocation loc;

	@Required
	public WorkdayType dayType;

	public PunchTime() {
		timeStamp = Calendar.getInstance().getTime();
	}

	public String toString() {
		return DateFormat.getTimeInstance().format(timeStamp);
	}

}
